package com.tubi.LocalDateTime;

import java.time.DayOfWeek;
import java.time.LocalDateTime;

public class LocalDateTime2 {
    public static void main(String[] args) {
        LocalDateTime of = LocalDateTime.of(2020, 11, 11, 11, 11, 11);
        //public int getYear()获取年
        int year = of.getYear();
        System.out.println("年为"+year);
        // public int getMonthValue()获取月份（1-12）
        int monthValue = of.getMonthValue();
        System.out.println("月份为"+monthValue);
        // public int getDayOfMonth()获取月份中的第几天（1-31）
        int dayOfMonth = of.getDayOfMonth();
        System.out.println("月份中的第"+dayOfMonth);
        // public int getDayOfYear()获取一年中的第几天（1-366）
        int dayOfYear = of.getDayOfYear();
        System.out.println("一年中的第"+dayOfYear);
        // public DayOfWeek getDayOfWeek()获取星期
        DayOfWeek dayOfWeek = of.getDayOfWeek();
        System.out.println("星期"+dayOfWeek);
        // public int getMinute()获取分钟
        int minute = of.getMinute();
        System.out.println("分钟"+minute);
        // public int getHour()获取小时
        int hour = of.getHour();
        System.out.println("小时"+hour);

    }
}
